package com.jwaoo.mobile.http;

import java.util.Map;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Url;

/**
 * Created by jwaoo on 2017/7/10.
 */

public interface IHttpServices {

    //https://segmentfault.com/a/1190000004880821  retrofit2.0 demo

    public final static String login = "oauth/v1/authenticate";
    public final static String users = "oauth/v1/users";
    public final static String account = "oauth/v1/me";

    @POST
    Call<ResponseBody> postLogin(
            @Url String url,
            @Body RequestBody requestBody
    );

    @GET
    Call<ResponseBody> getAccountInfo(
        @Url String url
    );

    @GET
    Call<ResponseBody> getAccountInfoList(
        @Url String url
    );

//    File file = new File(filePath);
//    Map<String, RequestBody> map = new HashMap<String, RequestBody>();
//    map.put("userId", RetrofitApi.getInstance().parseRequestBody(userId));
//    map.put(RetrofitApi.getInstance().parseImageMapKey("avatar", file.getName()), RetrofitApi.getInstance().parseImageRequestBody(file));
//
//    //cmd：user/avatar/upload
//    RetrofitApi.getInstance().uploadFile(cmd, map, listener);
}
